package com.snb.play.dwebtoon;

import java.io.File;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.Toast;

public class IntroActivity extends BaseActivity {

	public static String TAG = IntroActivity.class.getSimpleName();

	public static int mPageNum;
	public static int mTotalCount;
	public static String gTimeStamp = "";

	public static long UseSize = 0L;
	public static boolean gCheckedSize = false;

	public long getDirSize(File dir) {
		long size = 0;
		for (File file : dir.listFiles()) {
			if (file.isDirectory()) {
				size += getDirSize(file);
			} else
				size += file.length();
		}
		return size;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.activity_main);
		
	}

	@Override
	protected void onResume() {
		super.onResume();
		
		if (ContentListActivity.PACKEGNAME == null || ContentListActivity.PACKEGNAME.length() < 3)
			ContentListActivity.PACKEGNAME = getPackageName();
		gTimeStamp = String.valueOf(System.currentTimeMillis());

		mPageNum = 1;
		mTotalCount = 0;

		ImageView img = (ImageView) findViewById(R.id.img_loading);
		img.setVisibility(View.VISIBLE);
		Animation ani = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rounding);
		img.startAnimation(ani);
		
		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				startActivity(new Intent(IntroActivity.this, WebToonListActivity.class));
				overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
				finish();
			}
		}, 100);

	}

	@Override
	protected void refresh(String aString) {
		// TODO Auto-generated method stub
		Toast.makeText(this, aString + " 다운 완료!", Toast.LENGTH_LONG).show();
	}
}
